package com.gxa.controller.xiaohuocontroller;

import com.gxa.common.R;
import com.gxa.pojo.KeHuDingDan;
import com.gxa.pojo.XiaoHuoDan;
import com.gxa.pojo.ZhangHu;
import com.gxa.pojo.ZhiYuan;
import com.gxa.service.xiaohuoservice.KeHuDingDanService;
import com.gxa.service.xiaohuoservice.XiaoHuoDanService;
import io.swagger.annotations.*;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.ArrayList;

/**
 * @version 1.0
 * @Author fluoxetine
 * @Date 2022/3/31 10:42
 **/
@RestController
@RequestMapping("/XiaoHuo/XiaoHuoDan")
@Api(value = "销货单管理" , tags = "客户订单记录数据接口API")
@RequiresPermissions("销货单")
public class XiaoHuoDanController {
    @Autowired
    private XiaoHuoDanService xiaoHuoDanService;

    @RequestMapping(value = "/selectZhiYuan", method = RequestMethod.GET)
    @ApiOperation(value = "职员查询接口",  httpMethod = "get", response = R.class)
       @ApiResponses({
            @ApiResponse(code = 200, message = "请求成功"),
            @ApiResponse(code = 404, message = "找不到页面"),
            @ApiResponse(code = 500, message = "后台服务器错误")
    })
    public R selectZHiYuan(String zhiyuan) {
        return xiaoHuoDanService.selectZhiYuan(zhiyuan);
    }

    @PostMapping("/addXiaoHuoDan")
    @ApiOperation(value="新增销货单接口",notes="提供订单信息",httpMethod = "post",response = R.class)
    @ApiResponses({
            @ApiResponse(code=200,message="请求成功"),
            @ApiResponse(code=404,message="找不到页面"),
            @ApiResponse(code=500,message="后台服务错误")
    })
    public R addXiaoHuoDan(@RequestBody XiaoHuoDan xiaoHuoDan){
        return xiaoHuoDanService.addXiaoHuoDan(xiaoHuoDan);
    }

    @RequestMapping(value = "/fanShenHe", method = RequestMethod.POST)
    @ApiOperation(value = "销货单反审核接口", notes = "提供当前页码数与每页显示条数", httpMethod = "post", response = R.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id", value = "客户订单id", required = true, dataType = "int", paramType = "query"),
    })
    @ApiResponses({
            @ApiResponse(code = 200, message = "请求成功"),
            @ApiResponse(code = 404, message = "找不到页面"),
            @ApiResponse(code = 500, message = "后台服务器错误")
    })
    public R fanShenHe(String id) {
        R r = new R();
        r.setCode(200);
        r.setMsg("反审核成功");
        return r;
    }

    @RequestMapping(value = "/selectZhangHu", method = RequestMethod.GET)
    @ApiOperation(value = "账户查询接口", httpMethod = "get", response = R.class)
    @ApiResponses({
            @ApiResponse(code = 200, message = "请求成功"),
            @ApiResponse(code = 404, message = "找不到页面"),
            @ApiResponse(code = 500, message = "后台服务器错误")
    })
    public R selectZhangHu(String zhangHu) {
        return xiaoHuoDanService.selectZhangHu(zhangHu);
    }
}